This document contains:

Importantly, if something went wrong and you could not install the software, please find me before the workshop so we can try to troubleshoot. We cannot afford to waste any time on issues like installation during the workshop.

1 Installing the software

You must have two pieces of (free) software installed on you laptop (which you should bring with you) before coming to the workshop. The installation process is very simple.

1.1 Installing R

First and foremost, you need R. If you have R installed already, update it to the most recent version (which is done just by downloading the most recent installer and installing). Depending on your operating system, go to:

Download the installer and install (with default options, just keep clicking Next). Run the R once to see that it works (in Windows, Rgui.exe should appear as a shortcut in the start menu and/or desktop; on a Mac, look for the R application in Finder). It should look something like this, depending on your OS:

on a Mac on Windows

Good job. Now close R (if it asks to save the workspace: not necessary). Once you get RStudio, there is no need to look at this ugly interface ever again.

1.2 Installing RStudio

While it is completely fine to use R from the command line or the bare-bones R interface application, we are going to use RStudio, which will make using R a lot easier and less of a hassle. It also has nice support for R Markdown, which we will be using. Go to:

Download and install. Run RStudio (again, look for the shortcut in Start Menu/Finder or the desktop).

RStudio is an integrated development environment for R (which is why we had to install that first) - the Console panel on the left is basically the same thing that you saw when you ran “plain” R. But RStudio also features a number of very helpful things that will become apparent in the workshop. RStudio comes with a handy script editor, which we are going to use right away.

1.3 Configuring RStudio output options

Before we do that, we need to quickly change two options in RStudio to make it behave in a more useful way for us (fortunately, the RStudio interface is highly customisable). Go to Tools -> Global Options, choose the Code tab on the left, and tick Soft-wrap R source file (this will make using the script editor much easier, by wrapping long lines so you won’t have to keep scrolling left and right all the time).
Then, again in the Global Options, click on the R Markdown tab on the left, and untick (make sure the tick box is empty) the option Show output inline for all R Markdown documents. This will disable notebook-style plot previews in the script editor and show plots on their own.

1.4 Packages and R Markdown

Almost done! We need to make sure your RStudio and certain packages get along so we can use R Markdown and some more advanced plotting tools in the workshop. During this process, RStudio might need to download a few things - make sure you have internet access.

  1. Copy-paste this bit of code into the R console in RStudio and press Enter. It should start downloading packages, indicated by some red text telling you it’s downloading from such and such url. Read though steps 2-6 while it’s doing that.
install.packages(c("corrplot", "wordcloud", "igraph", "visNetwork", "raster", "plotly", "rmarkdown", "quanteda"))
  1. Now let’s make sure R Markdown works. Click on New File (either in the menu, or white button in the top left corner), and choose “R Markown…”.
  2. At this point, RStudio might ask you to install some packages (although this should have been taken care of already). If so, click “Yes”.
  3. When this is done, a new window will appear, titled “New R Markdown…”. Just click “OK” to create the default document.
  4. A new script file tab should appear in the script editor, probably titled “Untitled.Rmd”. It has some example contents.
  5. Save the new .Rmd file (click on the little blue save icon, give it some name and save).
  6. Now click on the little “Knit” icon (with the blue ball of yarn) on top of the script panel. A new window should appear, containing a simple webpage, titled “Untitled”, telling you that “This is an R Markdown document. Markdown is a simple formatting syntax for authoring HTML…”

Feel free to close this window now. If all this worked, great! If not, find me beforehand so we can fix this. As the last step, download the script file for the workshop.

2 Download the script file for the workshop before the workshop begins (important!)

If it downloads as intended, then you should be able to open it with RStudio. If it just opens in the browser as a plain text file when you click the link, instead of downloading, try right-clicking (CTRL+click on a Mac) on the link and selecting Save link as...).
If for some reason it got saved as a .txt file instead - apparently can happen on some Macs: make sure the name of the file ends in .Rmd and not .Rmd.txt - delete the .txt suffix if necessary. After that, double-clicking it should open it in RStudio.

Feel free to browse the script beforehand if you’d like, but also don’t be intimidated by the amount of code: you will be guided through all the exercises in the workshop (except for the bonus sections, which are meant as additional material to be explored on your own, once you’ve learned the basics).





3 Sneak peek

By the way, these are the sort of things you will be easily able to create after participating in the workshop + following the post-workshop bonus sections: